<template>
	<!-- 法人旅行社记账 -->
	<view class="container">
		<!-- @reset="formReset" -->
		<uni-transition :duration="1000" :mode-class="'slide-bottom'"  :show="true" >
			<view class="" v-if="object.adopt_id==2" style="text-align: center;margin: 20rpx 0;">
				<text style="color:#FC3E2C;font-weight: bold;" >未通过原因:{{object.fail}}</text>
			</view>
		</uni-transition>
		<form @submit="formSubmitTravel">
			<uni-transition :duration="1000"  :mode-class="'slide-right'"  :show="true" >
			<view class="container-back" >
				<view class="back padding20  " >
					<view class="fontWeight" style="margin-bottom: 20rpx;">日期</view>
					<u-line color="#dadada" style=""></u-line>
					<view class="" @click="dateChange" style="display: flex;justify-content: space-between;margin-top: 20rpx;">
						<text>{{date}}</text>
						<img style="width: 20rpx;height:20rpx;" src="../static/right.png" alt="">
					</view>
				</view>
			</view>
			<view class="container-back">
				<view class="back padding20 ">
					<view class="flex Jbetween padding-bottom20 ">
						<view class="fontWeight">本月营业收入</view>
						<view class="textColor fontWeight">
							总收入:{{Number(domestic_tourism)+Number(inbound_tourism)+Number(outbound_tourism) || 0}} 人民币元</view>
					</view>
					<view class="travel-list flex Jbetween Acenter page">
						<view class="flex Acenter " style="flex: 5;">
							<view class="block-back inline-block travel-img flex Jcenter Acenter">
								<image style="width: 50rpx;height: 50rpx;" src="../../../static/guoneilvyou.png"
									mode="">
								</image>
							</view>
							<text class="fontWeight" style="color: #515151;">国内旅游营业收入</text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<!-- <input style="flex: 2" placeholder="点击输入" class="padding-left30" type="digit" name="domestic_tourism" :vlaue="domestic_tourism" @input="domesticTourism"></input> -->
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="domestic_tourism"  :value="domestic_tourism"   @input="domesticTourism">
							<text style="flex: 2;text-align: right;">人民币元</text>
						</view>
					</view>
					<view class="travel-list flex Jbetween Acenter page">
						<view class="flex Acenter " style="flex: 5;">
							<view class="block-back inline-block travel-img flex Jcenter Acenter">
								<image style="width: 50rpx;height: 50rpx;" src="../../../static/rujinglvyou.png"
									mode="">
								</image>
							</view>
							<text class="fontWeight" style="color: #515151;">入境旅游营业收入</text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="inbound_tourism"  :value="inbound_tourism"   @input="inboundTourism">
							<text style="flex: 2;text-align: right;">人民币元</text>
						</view>
					</view>
					<view class="travel-list flex Jbetween Acenter page">
						<view class="flex Acenter " style="flex: 5;">
							<view class="block-back inline-block travel-img flex Jcenter Acenter">
								<image style="width: 50rpx;height: 50rpx;" src="../../../static/chujinglvyou.png"
									mode="">
								</image>
							</view>
							<text class="fontWeight" style="color: #515151;">出境旅游营业收入</text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="outbound_tourism"  :value="outbound_tourism"   @input="outboundTourism">
							<text style="flex: 2;text-align: right;">人民币元</text>
						</view>
					</view>
				</view>
			</view>
			<view class="container-back" style="padding-top: 0;">
				<view class="back padding20 ">
					<view class="flex Jbetween padding-bottom20 ">
						<view class="fontWeight">本月接待游客人数</view>
						<view class="textColor fontWeight">总人次：{{Number(organized_number)+Number(domest_number)+Number(inbound_number)+Number(entry_number)+Number(personnel_number) || 0}} 人次</view>
					</view>
					<view class="travel-list flex Jbetween Acenter page">
						<view class="flex Acenter " style="flex: 5;">
							<view class="block-back inline-block travel-img flex Jcenter Acenter">
								<image style="width: 50rpx;height: 50rpx;" src="../../../static/zhuzhiyouke.png"
									mode="">
								</image>
							</view>
							<text class="fontWeight" style="color: #515151;">国内组织游客人数</text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="organized_number"  :value="organized_number"   @input="organizedNumber">
							<text style="flex: 2;text-align: right;">人次</text>
						</view>
					</view>
					<view class="travel-list flex Jbetween Acenter page">
						<view class="flex Acenter " style="flex: 5;">
							<view class="block-back inline-block travel-img flex Jcenter Acenter">
								<image style="width: 50rpx;height: 50rpx;" src="../../../static/jiedai.png"
									mode="">
								</image>
							</view>
							<text class="fontWeight" style="color: #515151;">国内接待游客人数</text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="domest_number"  :value="domest_number"   @input="domestNumber">
							<text style="flex: 2;text-align: right;">人次</text>
						</view>
					</view>
					<view class="travel-list flex Jbetween Acenter page">
						<view class="flex Acenter " style="flex: 5;">
							<view class="block-back inline-block travel-img flex Jcenter Acenter">
								<image style="width: 50rpx;height: 50rpx;" src="../../../static/wailian.png"
									mode="">
								</image>
							</view>
							<text class="fontWeight" style="color: #515151;">入境外联游客人数</text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="inbound_number"  :value="inbound_number"   @input="inboundNumber">
							<text style="flex: 2;text-align: right;">人次</text>
						</view>
					</view>
					<view class="travel-list flex Jbetween Acenter page">
						<view class="flex Acenter " style="flex: 5;">
							<view class="block-back inline-block travel-img flex Jcenter Acenter">
								<image style="width: 50rpx;height: 50rpx;" src="../../../static/rujingjiedai.png"
									mode="">
								</image>
							</view>
							<text class="fontWeight" style="color: #515151;">入境接待游客人数</text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="entry_number"  :value="entry_number"   @input="entryNumber">
							<text style="flex: 2;text-align: right;">人次</text>
						</view>
					</view>
					<view class="travel-list flex Jbetween Acenter page">
						<view class="flex Acenter " style="flex: 5;">
							<view class="block-back inline-block travel-img flex Jcenter Acenter">
								<image style="width: 50rpx;height: 50rpx;" src="../../../static/youkerenshu.png"
									mode="">
								</image>
							</view>
							<text class="fontWeight" style="color: #515151;">出境游客人数</text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="personnel_number"  :value="personnel_number"   @input="personnelNumber">
							<text style="flex: 2;text-align: right;">人次</text>
						</view>
					</view>
			    </view>
			</view>
			<view class="container-back" style="padding-top: 0;">
				<view class="back padding20 ">
					<view class="flex Jbetween padding-bottom20 ">
						<view class="fontWeight">本月燃气量</view>
					</view>
					<view class="travel-list flex Jbetween Acenter page">
						<view class="flex Acenter " style="flex: 5;">
							<view class="block-back inline-block travel-img flex Jcenter Acenter">
								<image style="width: 60rpx;height: 60rpx;" src="../../../static/tianranqi.png" mode="">
								</image>
							</view>
							<text class="fontWeight" style="color: #515151;">天然气</text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 1"  class="padding-left30"  type="digit"  placeholder="点击输入" name="natural"  :value="natural"   >
							<text style="text-align: right;">(标准立方米)</text>
						</view>
					</view>
					<view class="travel-list flex Jbetween Acenter page">
						<view class="flex Acenter " style="flex: 5;">
							<view class="block-back inline-block travel-img flex Jcenter Acenter">
								<image style="width: 50rpx;height: 50rpx;" src="../../../static/meiqi.png" mode="">
								</image>
							</view>
							<text class="fontWeight" style="color: #515151;">煤气</text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 1"  class="padding-left30"  type="digit"  placeholder="点击输入" name="coal"  :value="coal"   >
							<text style="text-align: right;">(字)</text>
						</view>
					</view>
					<view class="travel-list flex Jbetween Acenter page">
						<view class="flex Acenter " style="flex: 5;">
							<view class="block-back inline-block travel-img flex Jcenter Acenter">
								<image style="width: 50rpx;height: 50rpx;" src="../../../static/qita.png" mode="">
								</image>
							</view>
							<text class="fontWeight" style="color: #515151;">其它</text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 1"  class="padding-left30"  type="text"  placeholder="点击输入" name="other"  :value="other"    @input="otherChange" >
							<text style="text-align: right;"></text>
						</view>
					</view>
			    </view>
			</view>
			<view class="container-back" style="padding-top: 0;">
				<view class="back padding20 ">
					<view class="travel-list flex Jbetween Acenter ">
						<view class="flex Acenter " style="flex: 5;">
							<text class="fontWeight " style="color: #515151;"><text
									class="">本月员工总数</text></text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="total_num"  :value="total_num" >
							<text style="flex: 2;text-align: right;">人</text>
						</view>
					</view>
			    </view>
			</view>
			<view class="container-back" style="padding-top: 0;">
				<view class="back padding20 ">
					<view class="travel-list flex Jbetween Acenter ">
						<view class="flex Acenter " style="flex: 5;">
							<text class="fontWeight " style="color: #515151;"><text
									class="m">本月员工平均工资</text></text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="average_salary"  :value="average_salary" >
							<text style="flex: 2;text-align: right;">人民币元</text>
						</view>
					</view>
			    </view>
			</view>
			<view class="container-back" style="padding-top: 0;">
				<view class="back padding20 ">
					<view class="travel-list flex Jbetween Acenter ">
						<view class="flex Acenter " style="flex: 5;">
							<text class="fontWeight " style="color: #515151;"><text
									class="">本月用水量</text></text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="water_consum"  :value="water_consum" >
							<text style="flex: 2;text-align: right;">吨</text>
						</view>
					</view>
			    </view>
			</view>
			<view class="container-back" style="padding-top: 0;">
				<view class="back padding20 ">
					<view class="travel-list flex Jbetween Acenter ">
						<view class="flex Acenter " style="flex:5;">
							<text class="fontWeight " style="color: #515151;"><text
									class="">本月用电量</text></text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="ctricity_consum"  :value="ctricity_consum" >
							<text style="flex: 2;text-align: right;">度</text>
						</view>
					</view>
			    </view>
			</view>
			<view class="container-back" style="padding-top: 0;">
				<view class="back padding20 ">
					<view class="travel-list flex Jbetween Acenter " >
						<view class="flex Acenter " style="flex: 5;">
							<text class="fontWeight " style="color: #515151;"><text
									class="">本月物业管理费用</text></text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="management"  :value="management" >
							<text style="flex: 2;text-align: right;">人民币元</text>
						</view>
					</view>
			    </view>
			</view>
			<view class="container-back" style="padding-top: 0;">
				<view class="back padding20 ">
					<view class="travel-list flex Jbetween Acenter ">
						<view class="flex Acenter " style="flex:5;">
							<text class="fontWeight " style="color: #515151;"><text
									class="">本月租赁费用</text></text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="rental_expenses"  :value="rental_expenses" >
							<text style="flex: 2;text-align: right;">人民币元</text>
						</view>
					</view>
			    </view>
			</view>
			<view class="container-back" style="padding-top: 0;">
				<view class="back padding20 ">
					<view class="travel-list flex Jbetween Acenter ">
						<view class="flex Acenter " style="flex: 5;">
							<text class="fontWeight" style="color: #515151;"><text
									>本月维修（护）费用</text></text>
						</view>
						<view class="flex Acenter" style="flex: 5;">
							<input  style="flex: 2"  class="padding-left30"  type="digit"  placeholder="点击输入" name="tenance_cost"  :value="tenance_cost" >
							<text style="flex: 2;text-align: right;">人民币元</text>
						</view>
					</view>
			    </view>
			</view>
			 </uni-transition>
			<view class="button-submit">
				<view class="button">
					<button formType="submit" style="margin-top: 0; width: 100%">{{object.adopt_id==2?'重新提交':"提交"}}</button>
				</view>
			</view>
		</form>
		<!-- 日期选择器 -->
		  <u-picker mode="time" v-model="isPicderShow" :params="params" @confirm="confirm"></u-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				date:'请选择',
				 isPicderShow: false,
				object:{
					adopt_id: "", //审核是否通过
					fail: "记账内容需重新提交，有问题请联系联络人。", //未通过原因
					type_id:""//1  参团   2  非参团
				},
				params: {
					year: true,
					month: true,
					day: false,
					hour: false,
					minute: false,
					second: false
				},
				user_type:'',//用户类型  法人 自然人 联络人 
				id:'',//用户id,
				year:'',//年份
				month:'',//月份
				operating:"",//本月营业总收入
				tour_num:"",//
				business_specific_type:'',//具体业务类型
				// 表单绑定数据 用于赋值
				// form:{
				// 	domestic_tourism: "", //国内旅游营业收入
				// 	inbound_tourism: "", //入境旅游营业收入
				// 	outbound_tourism: "", //。出境旅游营业收入
				// 	organized_number:"",//国内组织游客人数
				// 	domest_number:'',//国内接待游客人数
				// 	inbound_number:"",//入境外联游客人数
				// 	entry_number:"",//入境接待游客人数
				// 	personnel_number:"",//出境游客人数
				// 	total_num:"",//本月员工总数
				// 	average_salary:"",//本月员工平均工资
				// 	water_consum:"",//本月用水量
				// 	ctricity_consum:"",//本月用电量
				// 	natural:"",//天然气
				// 	coal:"",//煤气
				// 	other:"",//其它
				// 	management:"",//本月物业管理费用
				// 	rental_expenses:"",//本月租赁费用
				// 	tenance_cost:"",//本月维护费用
				// },
				domestic_tourism: "", //国内旅游营业收入
				inbound_tourism: "", //入境旅游营业收入
				outbound_tourism: "", //。出境旅游营业收入
				organized_number:"",//国内组织游客人数
				domest_number:'',//国内接待游客人数
				inbound_number:"",//入境外联游客人数
				entry_number:"",//入境接待游客人数
				personnel_number:"",//出京游客人数
				total_num:"",//本月员工总数
				average_salary:"",//本月员工平均工资
				water_consum:"",//本月用水量
				ctricity_consum:"",//本月用电量
				natural:"",//天然气
				coal:"",//煤气
				other:"",//其它
				management:"",//本月物业管理费用
				rental_expenses:"",//本月租赁费用
				tenance_cost:"",//本月维护费用
				otherName:'',//具体名目
				timestamp:'',//当前日期时间
				jizhang_score:null//记账累计分数
			}
		},
		onLoad(options) {
			var myDate = new Date();//获取系统当前时间
			this.timestamp=myDate .getDate(); //获取当前日(1-31)
			var  year=myDate.getFullYear()
			var  month=myDate.getMonth()+1
			if(this.timestamp<10){//10号以内积分10分 否则积分1分
				this.jizhang_score=3
			}else{
				this.jizhang_score=1
			}
			
			let userInfo=uni.getStorageSync("userInfo")
			
			var ID=userInfo[0].id//用户id赋值
			
			if(userInfo){
				if(userInfo.user_type==="法人"){
					this.user_type=1
				}else if(userInfo.user_type==="联络人"){
					this.user_type=2
				}
				this.business_specific_type=userInfo[0].business_specific_type
			}
			var params= JSON.parse(options.item)
			console.log('获取历史记账页传递过来的列表参数paramsparamsparams',params)
			if(params.clickType==='new'){//说明是重新提交跳转过来的
				console.log('走的重新提交跳转过来的', params)
				this.date=year+" 年 "+params.month+" 月 "
				this.year=year
				this.month=params.month
				this.object.adopt_id = params.adopt_id   //1  待审核   2  未通过  3.已通过
				this.object.fail = params.fail?params.fail:"记账内容需重新提交，有问题请联系联络人。" //失败原因
				this.object.type_id=params.type_id//法人记账类型
				this.id=params.id
				console.log('最终赋值后的参数',params,this.object)
				
				let obj={
					id: params.id,
					user_type : params.user_type,
					month:params.month,
					keyword:params.col == 1 ? 'totel' : 'turnover',
					type_id:params.type_id
				}
				// 调用详情赋值数据
				this.getBillDetails(obj)
				
			}else if(params.clickType==='add'){ 
				console.log('正常点击加号跳转过来的正常点击加号跳转过来的正常点击加号跳转过来的正', params)
				this.id=userInfo[0].id
				console.log('month',month)
				if(month==1){
					this.month=12
					this.year=year-1//去上个年份
				}else{
					this.year=year
					this.month=month
				}
				// 赋值年份和月份
				this.date=year+" 年 "+month+" 月 "
				
			}else if(params.clickType==='month'){
				console.log('点击月份跳转进来德点击月份跳转进来德点击月份跳转进来德点击月份跳转进来德', params)
				if(params.month){//如果有值说明是点击了日历月份。。否则就正常传递当前鱼粉
					let newMonth=Number(params.month)
					console.log('有值',newMonth)
					this.month=newMonth
				    // 赋值年份和月份
					this.date=params.year+" 年 "+params.month+" 月 "
					this.year=params.year
					
				}else {//否则赋值当前年份和月份 
					this.date=year+" 年 "+month+" 月 "
				}
				this.id=params.id
				console.log('之后',this.month)
			}else{
				console.log('联络人帮忙记账过来的',params)
				this.id=params.id
				this.year=params.year
				this.month=params.month
				this.business_specific_type=params.business_specific_type
				this.jizhang_score=params.jizhang_score
				this.user_type=params.user_type
				this.date=params.year+" 年 "+params.month+" 月 "//日期自动赋值
			}
		},
		methods: {
			domesticTourism: function(e) {this.domestic_tourism= e.detail.value},//国内旅游营业收入输入事件
			inboundTourism: function(e) {this.inbound_tourism = e.detail.value},//入境旅游营业收入输入事件
			outboundTourism: function(e) {this.outbound_tourism = e.detail.value},//出京旅游营业收入事件
			organizedNumber:function(e){this.organized_number=e.detail.value},//国内组织游客人数
			domestNumber:function(e){this.domest_number=e.detail.value},//国内接待游客人数
			inboundNumber:function(e){this.inbound_number=e.detail.value},//入境外联游客人数
			entryNumber:function(e){this.entry_number=e.detail.value},//入境接待游客人数
			personnelNumber:function(e){this.personnel_number=e.detail.value},//出京游客人数
			totalNum:function(e){this.total_num=e.detail.value},//本月员工总数
			averageSalary:function(e){this.average_salary=e.detail.value},//本月员工平均工资
			waterConsum:function(e){this.water_consum=e.detail.value},//本月用水量
			ctricityConsum:function(e){this.ctricity_consum=e.detail.value},//本月用电量
			naturalChange:function(e){this.natural=e.detail.value},//天然气
			coalChange:function(e){this.coal=e.detail.value},//煤气
			managementChange:function(e){this.management=e.detail.value},//本月物业管理费用
			rentalExpenses:function(e){this.rental_expenses=e.detail.value},//本月租赁费用
			tenanceCost:function(e){this.tenance_cost=e.detail.value},//本月维护费用
			otherNameChange:function(e){this.otherName=e.detail.value},
			otherChange:function(e){this.other=e.detail.value},
			// 获取详情数据
			getBillDetails(obj) {
				console.log('即将请求数据',obj)
				var _self = this;
					this.$.tipLoading('加载中')
				uni.request({
					method: 'POST',
					url: 'https://jizhang.xqyu.cn/index.php/api/index/get_bill_details',
					dataType: 'json',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					data:obj,
					success: function(res) {
						if(res.data.code==1){
							let result=res.data.data
							console.log('获取旅行社记账列表详情数据获取旅行社记账列表详情数据获取旅行社记账列表详情数据获取旅行社记账列表详情数据获取旅行社记账列表详情数据',result)
							_self.domestic_tourism = result.domestic_tourism//国内旅游营业收入赋值
							console.log('获取表单里的内容', _self.form)
							_self.inbound_tourism = result.inbound_tourism////入境旅游营业收入赋值
							_self.outbound_tourism = result.outbound_tourism//出境旅游营业收入赋值
							_self.organized_number = result.organized_number//国内组织游客人数赋值
							_self.domest_number = result.domest_number//国内接待游客人数赋值
							_self.inbound_number = result.inbound_number//入境外联游客人数赋值
							_self.entry_number = result.entry_number//入境接待游客人数赋值
							_self.personnel_number = result.personnel_number//出境游客人数赋值
							_self.total_num = result.total_num//本月员工总数赋值
							_self.average_salary = result.average_salary//本月员工平均工资赋值
							_self.water_consum = result.water_consum//本月用水量赋值
							_self.ctricity_consum = result.ctricity_consum//本月用电量赋值
							_self.natural = result.natural//天然气赋值
							_self.coal = result.coal//煤气赋值
							_self.other = result.other//其它赋值
							_self.management = result.management//本月物业管理费用赋值
							_self.rental_expenses = result.rental_expenses//本月租赁费用赋值
							_self.tenance_cost = result.tenance_cost//本月维护费用赋值
							_self.$.hideLoading()
						}else{
							_self.$.hideLoading()
							_self.$.toast(res.data.msg)
						}
					}
				})
			},
			// 日期选择器打开
			dateChange:function(){
				
				this.isPicderShow=true
				console.log('打开',this.isPicderShow)
			},
			// 日期选择器确定
			confirm:function(e){
				console.log('日期选择器确定',e)
				let year=Number(e.year) 
				let month= Number(e.month)
				var myDate = new Date();//获取系统当前时间
				let newYear=myDate.getFullYear()
				let newMonth=myDate.getMonth()+1
				console.log('nia',year)
				console.log('nia1',newYear)
				if(year>newYear){
					this.$.toast('不支持之后年份记账')
					return
				}
				if(month>newMonth){
					this.$.toast('不支持之后月份记账')
					return
				}
				this.date=year+" 年 "+month+" 月 "
			},
			// 表单提交
			formSubmitTravel: function(e) {
				var that = this;
				console.log('获取子组件的提交数据获取子组件的提交数据获取子组件的提交数据', e)
				// e.detail.value.other=e.detail.value.other+'-'+e.detail.value.otherName
				console.log('获取e',e)
				e.detail.value.operating=Number(e.detail.value.domestic_tourism)+Number(e.detail.value.inbound_tourism)+Number(e.detail.value.outbound_tourism)
				e.detail.value.tour_num=Number(e.detail.value.organized_number)+Number(e.detail.value.domest_number)+Number(e.detail.value.inbound_number)+Number(e.detail.value.entry_number)+Number(e.detail.value.personnel_number)
				e.detail.value.year=this.year
				e.detail.value.month=this.month
				e.detail.value.jizhang_score=this.jizhang_score//累计积分
				e.detail.value.uid=this.id
				e.detail.value.type_id=this.business_specific_type
				e.detail.value.flag=this.user_type
				e.detail.value.adopt_id=1  //1  待审批   2  未通过  3  已通过  4 初审通过
				e.detail.value.id=this.id  //重新提交传递的ID
				console.log('获取从传递的',e)
				let data =e.detail.value
				let {domestic_tourism, inbound_tourism, outbound_tourism, organized_number, domest_number, inbound_number, entry_number, personnel_number, total_num, average_salary, water_consum, ctricity_consum, natural, coal, otherName, other, management,rental_expenses, tenance_cost}=data//结构对象
				if(!domestic_tourism ){this.$.toast('请输入国内旅游营业收入') 
				return}
				if(!inbound_tourism ){this.$.toast('请输入入境旅游营业收入') 
				return}
				if(!outbound_tourism ){this.$.toast('请输入出境旅游营业收入')
				return}
				if(!organized_number ){this.$.toast('请输入国内组织游客人数')
				return}
				if(!domest_number ){this.$.toast('请输入国内接待游客人数')
				return}
				if(!inbound_number ){this.$.toast('请输入入境外联游客人数')
				return}
				if(!entry_number ){this.$.toast('请输入入境接待游客人数')
				return}
				if(!personnel_number ){this.$.toast('请输入出境游客人数')
				return}
				if(!natural ){this.$.toast('请输入天然气')
				return}
				if(!coal ){this.$.toast('请输入煤气')
				return}
				if(!other ){this.$.toast('请输入具体名目')
				return}
				if(!total_num ){this.$.toast('请输入本月员工数')
				return}
				if(!average_salary ){this.$.toast('请输入本月员工平均工资')
				return}
				if(!water_consum ){this.$.toast('请输入本月用水量')
				return}
				if(!ctricity_consum ){this.$.toast('请输入本月用电量')
				return}
				if(!this.other ){this.$.toast('请输入其它')
				return}
				if(!management ){this.$.toast('请输入本月物业管理费用')
				return}
				if(!rental_expenses ){this.$.toast('请输入本月租赁费用')
				return}
				if(!tenance_cost ){this.$.toast('请输入本月维护费用')
				return}
				this.formRequest(e.detail.value)
			},
			formRequest:function(params){
				console.log('传递的数据',params)
				delete params.otherName//删除对象属性
				if(this.object.adopt_id==2){
					// 只有重新提交的时候才删除uid  传id
					delete params.uid
				}else {
					delete params.id
				}
				var that = this
				uni.showModal({
					title: '温馨提示',
					content: '确认提交后不可修改',
					success: function (res) {
						if (res.confirm) {
							uni.request({
								method: 'POST',
								url: 'https://jizhang.xqyu.cn/index.php/api/legal/get_agency',
								dataType: 'json',
								header: {
									'content-type': 'application/x-www-form-urlencoded'
								},
								data: params,
								success: function(res) {
									console.log('最终是否成功了',res.data)
									if(res.data.code==1){
										that.$.successToast(res.data.msg)
										//返回上一页
										setTimeout(function(){
											uni.navigateBack({delta:1})
										},1500)
									}else {
										that.$.toast(res.data.msg)
									}
								}
							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		background-color: #F5F5F5;

		.container-back {
			border-radius: 15rpx;
			padding: 20rpx;

			.travel-list {
				border-radius: 15rpx;
				padding: 10rpx;
				margin-bottom: 20rpx;

				.travel-img {
					width: 80rpx;
					height: 80rpx;
					border-radius: 15rpx;
					margin-right: 20rpx;
				}

				.before::before {
					content: '';
					width: 15rpx;
					height: 15rpx;
					border-radius: 50%;
					background-color: #1D69FC;
					position: absolute;
					margin-top: 12rpx;
					// margin-left: -30rpx;
				}
			}

			.travel-img {
				width: 80rpx;
				height: 80rpx;
				border-radius: 15rpx;
			}
		}

		.button-submit {
			background-color: #FFFFFF;
			position: fixed;
			margin-right: 20rpx;
			bottom: 0;
			width: 100%;
			padding-bottom: 30rpx;
			z-index: 1000;
			padding-left: 20rpx;
			padding-right: 20rpx;
			padding-top: 20rpx;

			.button {
				border-radius: 15rpx;

				button {
					background: linear-gradient(159deg, #80e6fc 0%, #0051ff 99%);
					// width: 100%;
					color: #FFFFFF;
					font-size: 30rpx;
				}
			}
		}
	}
</style>
